<ui:composition template="../index/index.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:define name="content">

		<h:form>

			<p:fieldset legend="Vizualização de Guias">
				<h:panelGrid columns="2" cellpadding="10">

					<h:outputLabel value="Plano de Saúde: " />
					<h:outputText value="#{guiaBean.guia.planoSaude.nome}" />

					<h:outputLabel value="Data: " />
					<h:outputText value="#{guiaBean.guia.dataInicial}" />
					
					<h:outputLabel value="Faturas: " />
				</h:panelGrid>
				<h:form>
					
					<p:dataTable value="#{guiaBean.guia.faturas}" var="fatura"
						paginator="true" rows="8">
						<p:column headerText="Estado">
							<h:outputText rendered="#{fatura.paga}" value="Paga" />
							<h:outputText rendered="#{!fatura.paga}" value="Pendente" />
						</p:column>

						<p:column headerText="Data">
							<h:outputText value="#{fatura.data}"></h:outputText>
						</p:column>

						<p:column headerText="Valor">
							<h:outputText value="#{fatura.valorFormatado}"></h:outputText>
						</p:column>
					</p:dataTable>
				</h:form>

				<h:commandButton action="list.xhtml" value="Voltar" />

			</p:fieldset>
		</h:form>
	</ui:define>
</ui:composition>